package yl.hs.bmipfull.daos.production;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import yl.hs.bmipfull.daos.BaseDao;
import yl.hs.bmipfull.pojo.production.ProductionDispatchLogEntity;

import java.util.List;
import java.util.Map;

/*
 * IProductionDispatchLogDao
 * @category
 * @author 谢景广
 * @date 2021-06-03
 */
@Repository
public interface IProductionDispatchLogDao extends BaseDao<ProductionDispatchLogEntity> {

    List<ProductionDispatchLogEntity> queryByDataSN(String dataSn);

    List<ProductionDispatchLogEntity> queryByEntity(@Param("map") Map<String, Object> query);
    Integer queryCountByCondition(@Param("map") Map<String, Object> query);

    /**
     * 根据数据编码和操作类型获取最新一条数据
     *
     * @param dataSn     数据编号
     * @param actionType 数据编号
     * @return 日志信息
     */
    ProductionDispatchLogEntity queryEntityByDataSNAndActionType(String dataSn, short actionType);

    List<ProductionDispatchLogEntity> queryListByMainSN(@Param("snList") List<String> snList, short[] typeArray);
}
